public class test {
    //蓝桥杯 数三角
    public class Main {
        static class Pair{
            public int x;
            public int y;
            public Pair(int x,int y){
                this.x = x;
                this.y = y;
            }
            @Override
            public boolean equals(Object o) {
                if (this == o) return true;
                if (o == null || getClass() != o.getClass()) return false;
                Pair pair = (Pair) o;
                return x == pair.x && y == pair.y;
            }

            @Override
            public int hashCode() {
                return Objects.hash(x, y);
            }
        }
        public static void main(String[] args) {
            Scanner in = new Scanner(System.in);
            HashSet<Pair> set = new HashSet<Pair>();
            HashMap<Integer, Integer> map = new HashMap<Integer, Integer>();
            int n = in.nextInt();
            int[] x = new int[n];
            int[] y = new int[n];
            for(int i = 0;i < n;i++) {
                x[i] = in.nextInt();
                y[i] = in.nextInt();
                set.add(new Pair(x[i], y[i]));
            }
            long count = 0;
            long line = 0;
            for(int i = 0;i < n;i++) {
                for(int j = 0;j < n;j++) {
                    if(i == j)continue;
                    int len = dis(x[i], y[i], x[j], y[j]);
                    count += map.getOrDefault(len, 0);

                    map.put(len, map.getOrDefault(len, 0) + 1);
                    int dx = x[i]*2 - x[j];
                    int dy = y[i]*2 - y[j];
                    if(set.contains(new Pair(dx, dy))) {
                        line++;
                    }
                }
                map.clear();
            }
            System.out.println(count - line/2);
        }
        public static int dis(int x1,int y1,int x2,int y2) {
            return (x1 - x2)*(x1 - x2) + (y1 - y2)*(y1 - y2);
        }
    }
    //leetcode 242.有效的字母异位词
    class Solution {
        public boolean isAnagram(String s, String t) {
            HashSet<String> set = new HashSet<>();
            char[] arr1 = s.toCharArray();
            char[] arr2 = t.toCharArray();
            Arrays.sort(arr1);
            Arrays.sort(arr2);
            String s1 = Arrays.toString(arr1);
            String s2 = Arrays.toString(arr2);
            return s1.equals(s2);
        }
    }
    //leetcode 205.同构字符串
    class Solution {
        public boolean isIsomorphic(String s, String t) {
            HashMap<Character,Character> map = new HashMap<>();
            for(int i = 0;i < s.length();i++){
                char c1 = s.charAt(i);
                char c2 = t.charAt(i);
                if(!map.containsKey(c1)){
                    if(map.containsValue(c2)){
                        return false;
                    }
                    map.put(c1,c2);
                }else {
                    if(map.get(c1) != c2){
                        return false;
                    }
                }
            }
            return true;
        }
    }
}
